<template lang="pug">
  img.icon(:style="`${styleString}`" :src="url")
</template>

<script>
export default {
  name: "SvgIcon",
  props: {
    icon: String,
    size: {
      type: Number,
      default: 50,
    }
  },
  computed: {
    url() {
      return require(`../../assets/images/icons/${this.icon}.svg`);
    },
    styleString() {
      return `width: rem(${this.size}); height: rem(${this.size});`;
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
